﻿<%@ Page Language="C#" AutoEventWireup="true" Title="<%$ Concat:UIStrings.Import,' &raquo; ResourceBlender.NET' %>" CodeFile="Import.aspx.cs" Inherits="Import" MasterPageFile="~/Layout.master" %>
<%@ Register TagPrefix="L49" Namespace="Lime49.UI" %>

<asp:Content ID="contentHead" ContentPlaceHolderID="head" runat="server">    
</asp:Content>

<asp:Content ID="contentMain" ContentPlaceHolderID="cntMain" runat="server">
    <asp:ScriptManager ID="scrImport" runat="server">
    </asp:ScriptManager>
    <asp:ObjectDataSource ID="dsApplications" runat="server" TypeName="ResourceBlender.DAL.ResourceBlenderDAL" SelectMethod="GetApplications">
        <SelectParameters>
            <asp:Parameter Name="includeBundles" Type="Boolean" DefaultValue="false" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <div class="niceform">
        <h1><asp:Literal ID="Literal4" runat="server" Text="<%$ Resources:UIStrings, Import %>" /></h1> 
        <asp:MultiView ID="mltImport" runat="server" ActiveViewIndex="0">
            <asp:View ID="viwNoApps" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:UIStrings, Import %>" />
                </div>
                <p><asp:Literal ID="litAddAppLink" runat="server" /></p>
            </asp:View>
            <asp:View ID="viwFiles" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavFilesHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:UIStrings, Import %>" />
                </div>
                <div class="formrow">
                    <asp:Label ID="lblFilename" AssociatedControlID="uplXlsFile" runat="server" Text="<%$ Resources:UIStrings, FileName %>"></asp:Label>
                    <asp:FileUpload ID="uplXlsFile" runat="server" />
                </div>
                <div class="formrow">
                    <asp:Label ID="lblFiletype" AssociatedControlID="radFiletype" runat="server" Text="<%$ Resources:UIStrings, FileType %>"></asp:Label>
                    <div class="checks">
                        <asp:RadioButtonList ID="radFiletype" runat="server" CssClass="plain autowidth">
                            <asp:ListItem Text="<%$ Resources:UIStrings, AutoDetect %>" Value="auto" Selected="True" />
                            <asp:ListItem Text="<%$ Resources:UIStrings, JavaDesc %>" Value="properties" />
                            <asp:ListItem Text="<%$ Resources:UIStrings, NETResxDesc %>" Value="resx" />
                            <asp:ListItem Text="<%$ Resources:UIStrings, PODesc %>" Value="po" />
                            <asp:ListItem Text="<%$ Resources:UIStrings, RBTDesc %>" Value="rbt" />
                            <asp:ListItem Text="<%$ Resources:UIStrings, XMLSpreadsheetDesc %>" Value="xml" />
                        </asp:RadioButtonList>
                    </div>
                </div>
                <asp:Label ID="lblError" runat="server" CssClass="block error" ></asp:Label>
                <div class="actions">
                    <asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="<%$ Resources:UIStrings, Upload %>" CssClass="uniformbutton btnGo" />
                </div>
            </asp:View>
            <asp:View ID="viwApp" runat="server">
                <div class="breadcrumbs">
                    <asp:HyperLink ID="lnkNavAppHome" runat="server" NavigateUrl="~/Default.aspx">ResourceBlender.NET</asp:HyperLink> &gt; <asp:HyperLink ID="lnkNavAppDone" runat="server" NavigateUrl="~/Import.aspx" Text="<%$ Resources:UIStrings, Import %>" />  &gt; <asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:UIStrings, ChooseApplication %>" />
                </div>
                <asp:UpdatePanel ID="updImport" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Timer ID="tmrImport" runat="server" Enabled="false" Interval="2500" OnTick="tmrImport_Tick">
                        </asp:Timer>
                        <p><asp:Literal ID="litUploadedInfo" runat="server"></asp:Literal></p>
                        <asp:Panel ID="pnlPromptApplication" runat="server">
                            <label class="block"><asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:UIStrings, Application %>" /></label>
                            <asp:RadioButtonList ID="radApplication" runat="server" RepeatLayout="Flow" 
                                CssClass="checks applicationChecks plain" DataSourceID="dsApplications" DataTextField="DisplayName" DataValueField="ID" />
                            <div class="clear"></div>
                            <asp:RequiredFieldValidator ID="vldApplication" runat="server" 
                                   ErrorMessage="<%$ Resources:Errors, ApplicationRequired %>" 
                                   ControlToValidate="radApplication" 
                                   CssClass="error" 
                                   Display="Dynamic" />
                            <div class="checks autowidth">
                                <asp:CheckBox ID="chkAppendLanguages" runat="server" Text="<%$ Resources:UIStrings, AddLanguagesNotInUse %>" Checked="true" CssClass="block" />
                                <asp:CheckBox ID="chkTreatNoExtAsDefault" runat="server" Text="<%$ Resources:UIStrings, TreatNoCultureAsDefault %>" Checked="true" CssClass="block" />
                            </div>
                        </asp:Panel>
                        <h3><asp:Literal ID="litProgress" runat="server" Visible="false" Text="<%$ Resources:UIStrings, Progress %>"></asp:Literal></h3>
                        <L49:FormattedList ID="lstProgress" runat="server">
                        </L49:FormattedList>
                        <asp:Image ID="imgProgress" runat="server" AlternateText="<%$ Resources:UIStrings, Importing %>" ImageUrl="images/ajax-small.gif" Visible="false" CssClass="block centered" />
                        <asp:Button ID="btnImport" runat="server" Text="<%$ Resources:UIStrings, Import %>" OnClick="btnImport_Click" CssClass="uniformbutton btnGo" />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="tmrImport" EventName="Tick" />
                    </Triggers>
                </asp:UpdatePanel>
            </asp:View>
            <asp:View ID="viwError" runat="server">
            <div class="niceform errorDiv">
                <h2><asp:Literal ID="Literal6" runat="server" Text="<%$ Resources:Errors, Error %>" /></h2>
                <p><asp:Literal ID="lblErrorDescription" runat="server" /></p>
            </div>
       </asp:View>
        </asp:MultiView>
    </div>
</asp:Content>